package com.xhwl.logistics.converter.mapstruct.logistics;


import com.xhwl.logistics.entity.logistics.VisitorRecord;
import com.xhwl.logistics.vo.logistics.VisitorRecordVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;


@Mapper(componentModel = "spring")
public interface VisitorRecordConverter {
    VisitorRecordConverter INSTANCE = Mappers.getMapper(VisitorRecordConverter.class);



    @Mapping(target ="materialPicUrl" ,ignore = true)
    @Mapping(target ="faceUrl" ,ignore = true)
    VisitorRecord toPoConvert(VisitorRecordVO source);

    @Mapping(target ="materialPicUrl" ,ignore = true)
    @Mapping(target ="faceUrl" ,ignore = true)
    VisitorRecordVO toVoConvert(VisitorRecord source);


    @Mapping(target ="materialPicUrl" ,ignore = true)
    @Mapping(target ="faceUrl" ,ignore = true)
    @IterableMapping(elementTargetType = VisitorRecord.class)
    List<VisitorRecord> toPoConvertList(List<VisitorRecordVO> source);

    @Mapping(target ="materialPicUrl" ,ignore = true)
    @Mapping(target ="faceUrl" ,ignore = true)
    @IterableMapping(elementTargetType = VisitorRecordVO.class)
    List<VisitorRecordVO> toVoConvertList(List<VisitorRecord> source);
}
